package com.kifas.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * @author brainmaster
 * 
 */
@Entity
@Table(name = "tb_bl_kontrak")
public class KontrakPembelianEntity implements Serializable {

	private static final long serialVersionUID = -6409880849505289020L;

	@Id
	@GeneratedValue
	@Column(name = "id_bl_kontrak")
	private Long idKontrakPembelian;

	@Column(name = "no_bl_kontrak")
	private String nomorKontrakPembelian;

	@ManyToOne
	@JoinColumn(name = "id_kontrak", nullable = false)
	private KontrakEntity kontrak;

	@ManyToOne
	@JoinColumn(name = "id_barang", nullable = false)
	private BarangEntity barang;

	@Column(name = "is_closed")
	private boolean closed;

	private Integer qty;

	@Column(name = "tanggal_kirim")
	@Temporal(TemporalType.DATE)
	private Date tanggalKirim;
	
	@Column(name= "created_by")
	private String createdBy;
	
	@Column(name= "created_date")
	@Temporal(TemporalType.TIMESTAMP)
	private Date createdDate;

	public KontrakPembelianEntity() {
	}

	public KontrakPembelianEntity(Long idKontrakPembelian, String nomorKontrakPembelian, KontrakEntity kontrak, BarangEntity barang, boolean closed,
			Integer qty, Date tanggalKirim, String createdBy, Date createdDate) {
		this.idKontrakPembelian = idKontrakPembelian;
		this.nomorKontrakPembelian = nomorKontrakPembelian;
		this.kontrak = kontrak;
		this.barang = barang;
		this.closed = closed;
		this.qty = qty;
		this.tanggalKirim = tanggalKirim;
		this.createdBy = createdBy;
		this.createdDate = createdDate;
	}

	public Long getIdKontrakPembelian() {
		return idKontrakPembelian;
	}

	public void setIdKontrakPembelian(Long idKontrakPembelian) {
		this.idKontrakPembelian = idKontrakPembelian;
	}

	public String getNomorKontrakPembelian() {
		return nomorKontrakPembelian;
	}

	public void setNomorKontrakPembelian(String nomorKontrakPembelian) {
		this.nomorKontrakPembelian = nomorKontrakPembelian;
	}

	public BarangEntity getBarang() {
		return barang;
	}

	public void setBarang(BarangEntity barang) {
		this.barang = barang;
	}

	public boolean isClosed() {
		return closed;
	}

	public void setClosed(boolean closed) {
		this.closed = closed;
	}

	public Integer getQty() {
		return qty;
	}

	public void setQty(Integer qty) {
		this.qty = qty;
	}

	public void setTanggalKirim(Date tanggalKirim) {
		this.tanggalKirim = tanggalKirim;
	}

	public Date getTanggalKirim() {
		return tanggalKirim;
	}

	public void setKontrak(KontrakEntity kontrak) {
		this.kontrak = kontrak;
	}

	public KontrakEntity getKontrak() {
		return kontrak;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	public String getCreatedBy() {
		return createdBy;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	public Date getCreatedDate() {
		return createdDate;
	}

}
